<%@page import="Object.User"%>
<div id="header">
    <%
    HttpSession sess = request.getSession();
    User user = (User) sess.getAttribute("User");
    if(user==null){
        user = new User();
    }

%>
Welcome <b><%= (user.isGuest())?"Guest":user.getUsername() %></b>

<div id="header-toolbar">
    <%
    if(user.isGuest()){
        %>
        <a href="UserController?action=Login">Login</a> |
        <a href="UserController?action=Register">Register</a> |
        <a href="UserController?action=Search">Search</a>
        <%
    } else if (user.isCustomer()){
        %>
        <a href="UserController?action=Search">Search</a> |
        <a href="UserController?action=ViewCart">View Cart</a> |
        <a href="UserController?action=ViewOrders">View All Order</a> |
        <a href="UserController?action=Logout">Logout</a>
        <%
    } else if (user.isAdmin()){
        %>
        
        <a href="ManagerController?action=CheckOrders">Check Orders</a> |
        <a href="ManagerController?action=ManageBooks">Books</a> |
        <a href="ManagerController?action=ManageTypes">Types</a> |
        <a href="ManagerController?action=ManageAuthors">Authors</a> |
        <a href="ManagerController?action=ManageAccounts">Accounts</a> |
        <a href="UserController?action=Logout">Logout</a>
        <%
    }
%>
</div>
</div>
<br/>